import java.util.Scanner;
import java.util.SortedMap;

public class Main1581 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n= sc.nextInt();
        int[] arr=new int[n];
        for (int i=0;i<arr.length;i++){
            arr[i]=sc.nextInt();
        }
        int max=0;
        for (int i=0;i< arr.length;i++){
            if (max<arr[i]){
                max=arr[i];
            }
        }
        for (int i=0;i< arr.length;i++){
            if (max%2==0) {
                if (arr[i]==max){
                    int temp=arr[i];
                    arr[i]=temp*2;
                }
            }else {
                if (arr[i]==max){
                    int temp=arr[i];
                    arr[i]=temp+1;
                }
            }
        }
        for (int i=0;i<n;i++){
            if (max%2==0){
                System.out.print(arr[i]+" ");
            }else System.out.print(arr[i]+" ");
        }
    }
}
